What could be causing the IndexError: list index out of range in my_sort function

visit shbcf.ru